/**
 * Copyright (c) HiSilicon (Shanghai) Technologies Co., Ltd. 2024-2025. All rights reserved.
 *
 * Description: Functions of all external interfaces of the application and HiLinkSDK. \n
 *
 * History: \n
 * 2024-01-27, Create file. \n
 */

#ifndef FUNC_CALL_LIST_H
#define FUNC_CALL_LIST_H

#ifdef __cplusplus
extern "C" {
#endif

typedef enum {
    APP_CALL_BASE = 0,
    /* hilink_kv_adapter.c */
    APP_CALL_HILINK_KV_STORE_INIT,
    APP_CALL_HILINK_SET_VALUE,
    APP_CALL_HILINK_GET_VALUE,
    APP_CALL_HILINK_DELETE_VALUE,
    APP_CALL_HILINK_GET_FILE_NAME,

    /* hilink_mem_adapter.c */
    APP_CALL_HILINK_MALLOC,
    APP_CALL_HILINK_FREE,
    APP_CALL_HILINK_MEMCMP,

    /* hilink_socket_adapter.c */
    APP_CALL_HILINK_GET_ADDR_INFO,
    APP_CALL_HILINK_FREE_ADDR_INFO,
    APP_CALL_HILINK_SOCKET,
    APP_CALL_HILINK_CLOSE,
    APP_CALL_HILINK_SET_SOCKET_OPT,
    APP_CALL_HILINK_BIND,
    APP_CALL_HILINK_CONNECT,
    APP_CALL_HILINK_RECV,
    APP_CALL_HILINK_SEND,
    APP_CALL_HILINK_RECV_FROM,
    APP_CALL_HILINK_SEND_TO,
    APP_CALL_HILINK_SELECT,
    APP_CALL_HILINK_GET_SOCKET_ERRNO,
    APP_CALL_HILINK_HTONL,
    APP_CALL_HILINK_NTOHL,
    APP_CALL_HILINK_HTONS,
    APP_CALL_HILINK_NTOHS,
    APP_CALL_HILINK_INET_ATON,
    APP_CALL_HILINK_INET_ADDR,
    APP_CALL_HILINK_INET_NTOA,

    /* hilink_stdio_adapter.c */
    APP_CALL_HILINK_VPRINTF,
    APP_CALL_HILINK_PRINTF,
    APP_CALL_HILINK_RAND,
    APP_CALL_HILINK_TRNG,

    /* hilink_str_adapter.c */
    APP_CALL_HILINK_STRLEN,
    APP_CALL_HILINK_STRCHR,
    APP_CALL_HILINK_STRRCHR,
    APP_CALL_HILINK_ATOI,
    APP_CALL_HILINK_STRSTR,
    APP_CALL_HILINK_STRCMP,
    APP_CALL_HILINK_STRNCMP,

    /* hilink_thread_adapter.c */
    APP_CALL_HILINK_CREATE_TASK,
    APP_CALL_HILINK_THREAD_SUSPEND,
    APP_CALL_HILINK_THREAD_RESUME,
    APP_CALL_HILINK_DELETE_TASK,
    APP_CALL_HILINK_GET_CURRENT_TASK_ID,
    APP_CALL_HILINK_MUTEX_CREATE,
    APP_CALL_HILINK_MUTEX_LOCK,
    APP_CALL_HILINK_MUTEX_UNLOCK,
    APP_CALL_HILINK_MUTEX_DESTROY,
    APP_CALL_HILINK_SEM_CREATE,
    APP_CALL_HILINK_SEM_WAIT,
    APP_CALL_HILINK_SEM_POST,
    APP_CALL_HILINK_SEM_DESTROY,
    APP_CALL_HILINK_MILLI_SLEEP,
    APP_CALL_HILINK_SCHED_YIELD,

    /* hilink_time_adapter.c */
    APP_CALL_HILINK_GET_OS_TIME,
    APP_CALL_HILINK_GET_UTC_TIME,

    /* hilink_open_ota_adapter.c */
    APP_CALL_HILINK_OTA_ADAPTER_FLASH_INIT,
    APP_CALL_HILINK_OTA_ADAPTER_GET_UPDATE_INDEX,
    APP_CALL_HILINK_OTA_ADAPTER_FLASH_ERASE,
    APP_CALL_HILINK_OTA_ADAPTER_FLASH_WRITE,
    APP_CALL_HILINK_OTA_ADAPTER_FLASH_READ,
    APP_CALL_HILINK_OTA_ADAPTER_FLASH_FINISH,
    APP_CALL_HILINK_OTA_ADAPTER_FLASH_MAX_SIZE,
    APP_CALL_HILINK_OTA_ADAPTER_RESTART,
    APP_CALL_HILINK_OTA_START_PROCESS,
    APP_CALL_HILINK_OTA_END_PROCESS,
    APP_CALL_HILINK_GET_REBOOT_FLAG,

    /* hilink_open_ota_mcu_adapter.c */
    APP_CALL_HILINK_GET_MCU_VERSION,
    APP_CALL_HILINK_NOTIFY_OTA_STATUS,
    APP_CALL_HILINK_NOTIFY_OTA_DATA,

    /* hilink_sys_adapter.c */
    APP_CALL_HILINK_RESTART,
    APP_CALL_HILINK_GET_SYSTEM_BOOT_REASON,

    /* hilink_sal_rsa.c */
    APP_CALL_HILINK_SAL_RSA_INIT,
    APP_CALL_HILINK_SAL_RSA_FREE,
    APP_CALL_HILINK_SAL_RSA_PARAM_IMPORT,
    APP_CALL_HILINK_RSA_PKCS1_VERIFY,
    APP_CALL_HILINK_RSA_PKCS1_DECRYPT,
    APP_CALL_HILINK_RSA_PKCS1_ENCRYPT,

    /* hilink_tls_client.c */
    APP_CALL_HILINK_TLS_CLIENT_CREATE,
    APP_CALL_HILINK_SET_TLS_CLIENT_OPTION,
    APP_CALL_HILINK_TLS_CLIENT_CONNECT,
    APP_CALL_HILINK_TLS_CLIENT_GET_CONTEXT_FD,
    APP_CALL_HILINK_TLS_CLIENT_READ,
    APP_CALL_HILINK_TLS_CLIENT_WRITE,
    APP_CALL_HILINK_TLS_CLIENT_IS_VALID_CERT,
    APP_CALL_HILINK_TLS_CLIENT_FREE_RESOURCE,

    /* hilink_sal_aes.c */
    APP_CALL_HILINK_SAL_AES_GCM_ENCRYPT,
    APP_CALL_HILINK_SAL_AES_GCM_DECRYPT,
    APP_CALL_HILINK_SAL_ADD_PADDING,
    APP_CALL_HILINK_SAL_GET_PADDING,
    APP_CALL_HILINK_SAL_AES_CBC_ENCRYPT,
    APP_CALL_HILINK_SAL_AES_CBC_DECRYPT,
    APP_CALL_HILINK_SAL_AES_CCM_ENCRYPT,
    APP_CALL_HILINK_SAL_AES_CCM_DECRYPT,

    /* hilink_sal_base64.c */
    APP_CALL_HILINK_SAL_BASE64_ENCODE,
    APP_CALL_HILINK_SAL_BASE64_DECODE,

    /* hilink_sal_drbg.c */
    APP_CALL_HILINK_SAL_DRBG_INIT,
    APP_CALL_HILINK_SAL_DRBG_DEINIT,
    APP_CALL_HILINK_SAL_DRBG_RANDOM,

    /* hilink_sal_kdf.c */
    APP_CALL_HILINK_SAL_HKDF,
    APP_CALL_HILINK_SAL_PKCS5_PBKDF2_HMAC,

    /* hilink_sal_md.c */
    APP_CALL_HILINK_SAL_MD_CALC,
    APP_CALL_HILINK_SAL_HMAC_CALC,
    APP_CALL_HILINK_SAL_MD_INIT,
    APP_CALL_HILINK_SAL_MD_UPDATE,
    APP_CALL_HILINK_SAL_MD_FINISH,
    APP_CALL_HILINK_SAL_MD_FREE,

    /* hilink_sal_mpi.c */
    APP_CALL_HILINK_SAL_MPI_INIT,
    APP_CALL_HILINK_SAL_MPI_FREE,
    APP_CALL_HILINK_SAL_MPI_EXP_MOD,
    APP_CALL_HILINK_SAL_MPI_CMP_INT,
    APP_CALL_HILINK_SAL_MPI_SUB_INT,
    APP_CALL_HILINK_SAL_MPI_CMP_MPI,
    APP_CALL_HILINK_SAL_MPI_READ_STRING,
    APP_CALL_HILINK_SAL_MPI_WRITE_STRING,
    APP_CALL_HILINK_SAL_MPI_READ_BINARY,
    APP_CALL_HILINK_SAL_MPI_WRITE_BINARY,

    /* hilink_network_adapter.c */
    APP_CALL_HILINK_GET_LOCAL_IP,
    APP_CALL_HILINK_GET_MAC_ADDR,
    APP_CALL_HILINK_GET_WIFI_SSID,
    APP_CALL_HILINK_SET_WIFI_INFO,
    APP_CALL_HILINK_RECONNECT_WIFI,
    APP_CALL_HILINK_CONNECT_WIFI,
    APP_CALL_HILINK_GET_NETWORK_STATE,
    APP_CALL_HILINK_GET_WIFI_BSSID,
    APP_CALL_HILINK_GET_WIFI_RSSI,

    /* hilink_softap_adapter.c */
    APP_CALL_HILINK_START_SOFT_AP,
    APP_CALL_HILINK_STOP_SOFT_AP,

    /* hilink_device.c */
    APP_CALL_HILINK_GET_DEV_INFO,
    APP_CALL_HILINK_GET_SVC_INFO,
    APP_CALL_HILINK_GET_AUTO_AC,
    APP_CALL_HILINK_PUT_CHAR_STATE,
    APP_CALL_HILINK_CONTROL_CHAR_STATE,
    APP_CALL_HILINK_GET_CHAR_STATE,
    APP_CALL_HILINK_GET_PIN_CODE,
    APP_CALL_HILINK_NOTIFY_DEV_STATUS,
    APP_CALL_HILINK_PROCESS_BEFORE_RESTART,

    /* hichain.h */
    APP_CALL_REGISTE_LOG,
    APP_CALL_GET_INSTANCE,
    APP_CALL_DESTROY,
    APP_CALL_SET_CONTEXT,
    APP_CALL_RECEIVE_DATA,
    APP_CALL_RECEIVE_DATA_WITH_JSON_OBJECT,
    APP_CALL_INIT_CENTER,
    APP_CALL_START_PAKE,
    APP_CALL_AUTHENTICATE_PEER,
    APP_CALL_DELETE_LOCAL_AUTH_INFO,
    APP_CALL_IMPORT_AUTH_INFO,
    APP_CALL_ADD_AUTH_INFO,
    APP_CALL_REMOVE_AUTH_INFO,
    APP_CALL_IS_TRUST_PEER,
    APP_CALL_LIST_TRUST_PEERS,
    APP_CALL_SET_SELF_AUTH_ID,

    /* hilink_ble_adapter.c */
    APP_CALL_GET_LOCAL_ADDRESS,
    APP_CALL_GET_LOCAL_NAME,
    APP_CALL_SET_LOCAL_NAME,
    APP_CALL_BLUETOOTH_FACTORY_RESET,
    APP_CALL_GET_BT_SCAN_MODE,
    APP_CALL_SET_BT_SCAN_MODE,
    APP_CALL_READ_BT_MAC_ADDR,
    APP_CALL_GET_PARIED_DEVICES_NUM,
    APP_CALL_GET_PAIR_STATE,
    APP_CALL_REMOVE_PAIR,
    APP_CALL_REMOVE_ALL_PAIRS,
    APP_CALL_READ_REMOTE_RSSI_VALUE,
    APP_CALL_IS_ACL_CONNECTED,
    APP_CALL_DISCONNECT_REMOTE_DEVICE,
    APP_CALL_CONNECT_REMOTE_DEVICE,
    APP_CALL_INIT_BT_STACK,
    APP_CALL_ENABLE_BT_STACK,
    APP_CALL_DISABLE_BT_STACK,
    APP_CALL_SET_DEVICE_NAME,
    APP_CALL_BLE_SET_ADV_DATA,
    APP_CALL_BLE_START_ADV,
    APP_CALL_BLE_STOP_ADV,
    APP_CALL_BLE_UPDATE_ADV,
    APP_CALL_BLE_SET_SECURITY_IO_CAP,
    APP_CALL_BLE_SET_SECURITY_AUTH_REQ,
    APP_CALL_BLE_GATT_SECURITY_RSP,
    APP_CALL_BLE_SCAN_FILTER_PARAM_SETUP,
    APP_CALL_BLE_SCAN_FILTER_ADD_REMOVE,
    APP_CALL_BLE_SCAN_FILTER_CLEAR,
    APP_CALL_BLE_SCAN_FILTER_ENABLE,
    APP_CALL_BLE_SET_SCAN_PARAMETERS,
    APP_CALL_BLE_START_SCAN,
    APP_CALL_BLE_STOP_SCAN,
    APP_CALL_BLE_GATT_REGISTER_CALLBACKS,
    APP_CALL_BLE_START_ADV_EX,
    APP_CALL_BLE_GATTS_REGISTER,
    APP_CALL_BLE_GATTS_UN_REGISTER,
    APP_CALL_BLE_GATTS_DISCONNECT,
    APP_CALL_BLE_GATTS_ADD_SERVICE,
    APP_CALL_BLE_GATTS_ADD_CHARACTERISTIC,
    APP_CALL_BLE_GATTS_ADD_DESCRIPTOR,
    APP_CALL_BLE_GATTS_START_SERVICE,
    APP_CALL_BLE_GATTS_STOP_SERVICE,
    APP_CALL_BLE_GATTS_DELETE_SERVICE,
    APP_CALL_BLE_GATTS_CLEAR_SERVICES,
    APP_CALL_BLE_GATTS_SEND_RESPONSE,
    APP_CALL_BLE_GATTS_SEND_INDICATION,
    APP_CALL_BLE_GATTS_SET_ENCRYPTION,
    APP_CALL_BLE_GATTS_REGISTER_CALLBACKS,
    APP_CALL_BLE_GATTS_START_SERVICE_EX,
    APP_CALL_BLE_GATTS_STOP_SERVICE_EX,

    /* hilink_ble_main.c */
    APP_CALL_HILINK_GET_DEVICE_SN,
    APP_CALL_HILINK_GET_SUB_PROD_ID,
    APP_CALL_HILINK_BT_GET_DEV_SURFACE_POWER,
    APP_CALL_HILINK_BT_GET_DEV_INFO,
    APP_CALL_HILINK_GET_CUSTOM_INFO,
    APP_CALL_HILINK_GET_MANU_ID,
    APP_CALL_HILINK_BT_GET_MAC_ADDR,
    APP_CALL_GET_DEVICE_VERSION,

    /* cmsis_liteos2.c */
    APP_CALL_OS_KERNEL_GET_TICK_COUNT,
    APP_CALL_OS_KERNEL_GET_TICK_FREQ,
    APP_CALL_OS_DELAY,
    APP_CALL_OS_THREAD_NEW,
    APP_CALL_OS_THREAD_TERMINATE,
    APP_CALL_OS_THREAD_GET_ID,
    APP_CALL_OS_MUTEX_NEW,
    APP_CALL_OS_MUTEX_DELETE,
    APP_CALL_OS_MUTEX_ACQUIRE,
    APP_CALL_OS_MUTEX_RELEASE,
    APP_CALL_OS_SEMAPHORE_NEW,
    APP_CALL_OS_SEMAPHORE_ACQUIRE,
    APP_CALL_OS_SEMAPHORE_RELEASE,
    APP_CALL_OS_SEMAPHORE_DELETE,
    APP_CALL_OS_THREAD_SUSPEND,
    APP_CALL_OS_THREAD_RESUME,

    APP_CALL_MAX
} app_call_func_list;

typedef enum {
    HILINK_CALL_BASE = 0,
    /* hilink.h */
    HILINK_CALL_HILINK_REGISTER_BASE_CALLBACK,
    HILINK_CALL_HILINK_MAIN,
    HILINK_CALL_HILINK_RESET,
    HILINK_CALL_HILINK_SET_SDK_ATTR,
    HILINK_CALL_HILINK_GET_SDK_ATTR,
    HILINK_CALL_HILINK_RESTORE_FACTORY_SETTINGS,
    HILINK_CALL_HILINK_GET_DEV_STATUS,
    HILINK_CALL_HILINK_GET_SDK_VERSION,
    HILINK_CALL_HILINK_REPORT_CHAR_STATE,
    HILINK_CALL_HILINK_IS_REGISTER,
    HILINK_CALL_HILINK_GET_NETWORKING_MODE,
    HILINK_CALL_HILINK_GET_REGISTER_STATUS,
    HILINK_CALL_HILINK_SET_SCHEDULE_INTERVAL,
    HILINK_CALL_HILINK_SET_MONITOR_SCHEDULE_INTERVAL,
    HILINK_CALL_HILINK_SET_NET_CONFIG_MODE,
    HILINK_CALL_HILINK_GET_NET_CONFIG_MODE,
    HILINK_CALL_HILINK_SET_NET_CONFIG_TIMEOUT,
    HILINK_CALL_HILINK_SET_OTA_BOOT_TIME,
    HILINK_CALL_HILINK_ENABLE_KITFRAMEWORK,
    HILINK_CALL_HILINK_ENABLE_BATCH_CONTROL,
    HILINK_CALL_HILINK_ENABLE_PROCESS_DEL_ERR_CODE,
    HILINK_CALL_HILINK_UNBIND_DEVICE,
    HILINK_CALL_HILINK_SET_DEVICE_INSTALL_TYPE,
    HILINK_CALL_HILINK_GET_DEV_SETUP_TYPE,
    HILINK_CALL_HILINK_ENABLE_DEV_ID_INHERIT,
    HILINK_CALL_HILINK_NOTIFY_NETWORK_AVAILABLE,

    /* hilink_log_manage.h */
    HILINK_CALL_HILINK_SET_LOG_LEVEL,
    HILINK_CALL_HILINK_GET_LOG_LEVEL,

    /* hilink_device.h */
    HILINK_CALL_HILINK_REGISTER_GET_AC_V2_FUNC,

    /* ble_cfg_net_api.h */
    HILINK_CALL_BLE_CFG_NET_INIT,
    HILINK_CALL_BLE_CFG_NET_DE_INIT,
    HILINK_CALL_BLE_CFG_NET_ADV_CTRL,
    HILINK_CALL_BLE_CFG_NET_ADV_UPDATE,
    HILINK_CALL_BLE_CFG_NET_DIS_CONNECT,
    HILINK_CALL_BLE_SEND_CUSTOM_DATA,
    HILINK_CALL_BLE_GET_ADV_TYPE,
    HILINK_CALL_BLE_SET_ADV_TYPE,
    HILINK_CALL_BLE_SET_ADV_NAME_MPP,
    HILINK_CALL_BLE_NEAR_DISCOVERY_INIT,
    HILINK_CALL_BLE_NEAR_DISCOVERY_ENABLE,
    HILINK_CALL_HILINK_BT_GET_TASK_STACK_SIZE,
    HILINK_CALL_HILINK_BT_SET_TASK_STACK_SIZE,

    /* hilink_bt_function.h */
    HILINK_CALL_HILINK_BT_SET_SDK_EVENT_CALLBACK,

    /* hilink_network_adapter.h */
    HILINK_CALL_HILINK_REG_WIFI_RECOVERY_CALLBACK,
    /* hilink_socket_adapter.h */
    HILINK_CALL_HILINK_REG_ERRNO_CALLBACK,

    HILINK_CALL_MAX
} hilink_call_func_list;

struct hilink_info_stru {
    void (*entry)(void **hilink_call_tbl, void *app_call_tbl);
};

#ifdef __cplusplus
}
#endif
#endif
